<include file="Common:header" />
<TYjs file='fix_table_title'/>
<div class="table_content">
    <div class="other">
        <a class="a_btn" href="{:U(MODULE_NAME.'/Menu/add_menu',array('type'=>'group'))}">添加分组</a>
    </div>
    <table class="list_table">
        <tr>
            <th width="100px">ID</th>
            <th width="300px">标题</th>
            <th style="min-width:100px;">备注</th>
            <th width="100px">是否显示</th>
            <th width="100px">是否开启</th>
            <th width="100px">排序</th>
            <th width="150px">操作</th>
        </tr>
        <volist name="menuList" id="voGroup" key="i">
            <tr>
                <td>{$voGroup.id}</td>
                <td style="padding-left: 6%;" class="td_l">
                    <img src="__PRIVATE__/Images/menu_group.png" class="menu_group" title="分组" style="width:20px;"/>
                    {$voGroup.name}&nbsp;
                    <a class="add" href="{:U(MODULE_NAME.'/Menu/add_menu',array('id'=>$voGroup['id'],'type'=>'class'))}" title="添加分类"></a>
                </td>
                <td>{$voGroup.remark}</td>
                <td><input type="button" class="js_status status_{$voGroup['is_show']?'enable':'disable'}" url="{:U(MODULE_NAME.'/Menu/change_menu_is_show',array('id'=>$voGroup['id']))}"/></td>
                <td><input type="button" class="js_status status_{$voGroup['status']?'enable':'disable'}"  url="{:U(MODULE_NAME.'/Menu/change_menu_status',array('id'=>$voGroup['id']))}"/></td>
                <td><input type="text" name="sort" class="js_sort text w50 sort" value="{$voGroup.sort}" url="{:U(MODULE_NAME.'/Menu/change_menu_sort',array('id'=>$voGroup['id']))}"/></td>
                <td>
                    <a class="edit" href="{:U(MODULE_NAME.'/Menu/edit_menu',array('id'=>$voGroup['id'],'type'=>'group'))}" title="{$Think.lang.edit}"></a>
                    <a class="delete" href="{:U(MODULE_NAME.'/Menu/delete_menu',array('id'=>$voGroup['id']))}" title="{$Think.lang.delete}"></a>
                </td>
            </tr>
            <volist name="voGroup['child']" id="voClass" key="j">
                <tr>
                    <td>{$voClass.id}</td>
                    <td class="td_l" style="padding-left: 6%;">
                <if condition="isset($voGroup['child'][$j+1])">
                    ├──
                    <else />
                    └──
                </if>
                {$voClass.name}&nbsp;
                <a class="add" href="{:U(MODULE_NAME.'/Menu/add_menu',array('id'=>$voClass['id'],'type'=>'menu'))}" title="{$Think.lang.add_menu}"></a>
                </td>
                <td>{$voClass.remark}</td>
                <td><input type="button" class="js_status status_{$voClass['is_show']?'enable':'disable'}" url="{:U(MODULE_NAME.'/Menu/change_menu_is_show',array('id'=>$voClass['id']))}"/></td>
                <td><input type="button" class="js_status status_{$voClass['status']?'enable':'disable'}" url="{:U(MODULE_NAME.'/Menu/change_menu_status',array('id'=>$voClass['id']))}"/></td>
                <td><input type="text" name="sort" class="js_sort text w50 sort" value="{$voClass.sort}" url="{:U(MODULE_NAME.'/Menu/change_menu_sort',array('id'=>$voClass['id']))}"/></td>
                <td>
                    <a class="edit" href="{:U(MODULE_NAME.'/Menu/edit_menu',array('id'=>$voClass['id'],'type'=>'class'))}" title="{$Think.lang.edit}"></a>
                    <a class="delete" href="{:U(MODULE_NAME.'/Menu/delete_menu',array('id'=>$voClass['id']))}" title="{$Think.lang.delete}"></a>
                </td>
                </tr>
                <volist name="voClass['child']" id="vo" key="k">
                    <tr>
                        <td>{$vo.id}</td>
                        <td class="td_l" style="padding-left: 6%;">
                    <if condition="isset($voClass['child'][$k])">
                        <if condition="isset($voGroup['child'][$j])">
                            │&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├──
                            <else/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├──
                        </if>
                        <else />
                        <if condition="isset($voGroup['child'][$j])">
                            │&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└──
                            <else/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└──
                        </if>
                    </if>
                    {$vo.name}</td>
                    <td>{$vo.remark}</td>
                    <td><input type="button" class="js_status status_{$vo['is_show']?'enable':'disable'}" url="{:U(MODULE_NAME.'/Menu/change_menu_is_show',array('id'=>$vo['id']))}"/></td>
                    <td><input type="button" class="js_status status_{$vo['status']?'enable':'disable'}" url="{:U(MODULE_NAME.'/Menu/change_menu_status',array('id'=>$vo['id']))}"/></td>
                    <td><input type="text" name="sort" class="js_sort text w50 sort" value="{$vo.sort}" url="{:U(MODULE_NAME.'/Menu/change_menu_sort',array('id'=>$vo['id']))}"/></td>
                    <td>
                        <a class="edit" href="{:U(MODULE_NAME.'/Menu/edit_menu',array('id'=>$vo['id'],'type'=>'menu'))}" title="{$Think.lang.edit}"></a>
                        <a class="delete" href="{:U(MODULE_NAME.'/Menu/delete_menu',array('id'=>$vo['id']))}" title="{$Think.lang.delete}"></a>
                    </td>
                    </tr>
                </volist>
            </volist>
        </volist>
    </table>
</div>
<include file="Common:footer" />
